package com.jiawa.wiki.controller;

import com.jiawa.wiki.domain.Demo;
import com.jiawa.wiki.domain.Test;
import com.jiawa.wiki.service.DemoSQLServeService;
import com.jiawa.wiki.service.DemoService;
import com.jiawa.wiki.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private DemoService demoService;

    @Autowired
    private DemoSQLServeService demoSQLServeService;

    @GetMapping("/list")
    public List<Demo> list (){
        return demoService.list();
    }

    @GetMapping("/count")
    public  int count(){
        return demoSQLServeService.count();
    }



}
